package com.jt.safe.ui.parent.fragment

import android.content.Intent
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.jt.safe.R
import com.jt.safe.base.BaseFragment
import com.jt.safe.ui.activity.VideoPlayActivity
import com.jt.safe.ui.adpter.ParentVideoAdapter
import com.jt.safe.viewmodel.NullViewModel
import kotlinx.android.synthetic.main.fragment_parent_video.*
import kotlinx.android.synthetic.main.home_title_bar_layout.*


class ParentVideoFragment : BaseFragment<NullViewModel>() {
    val data = mutableListOf("", "", "", "","", "", "", "")

    companion object {
        fun newInstance() = ParentVideoFragment()
    }

    override val layoutId: Int
        get() = R.layout.fragment_parent_video

    override fun initView() {
        title_tv.text = "视频秀"
        val parentVideoAdapter = ParentVideoAdapter()
        recycler.layoutManager = StaggeredGridLayoutManager(2, RecyclerView.VERTICAL)
        recycler.adapter = parentVideoAdapter
        parentVideoAdapter.setNewData(data)
        parentVideoAdapter.setOnItemClickListener { adapter, view, position ->
            startActivity(Intent(activity,VideoPlayActivity::class.java))
        }
    }

    override fun createObserver() {

    }

    override fun initData() {

    }
}